package com.ciwong.epaper.modules.me.util;

import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.support.v4.app.Fragment;
import android.util.Log;

import com.ciwong.epaper.R;
import com.ciwong.epaper.application.EpaperConstant;
import com.ciwong.epaper.bean.HideDownloadDialogBean;
import com.ciwong.epaper.modules.bookstore.ui.DuiBaActivity;
import com.ciwong.epaper.modules.cordva.html.TimeNewsActivity;
import com.ciwong.epaper.modules.epaper.bean.Answer;
import com.ciwong.epaper.modules.epaper.bean.Module;
import com.ciwong.epaper.modules.epaper.bean.ModuleContent;
import com.ciwong.epaper.modules.epaper.ui.NewBookDetailH5Activity;
import com.ciwong.epaper.modules.epaper.ui.NewWorkOnlineAnswerCordovaActivity;
import com.ciwong.epaper.modules.epaper.ui.TeacherRemarkActivity;
import com.ciwong.epaper.modules.evaluate.ui.RankingActivity;
import com.ciwong.epaper.modules.exam.ExamActivity;
import com.ciwong.epaper.modules.interactivetutorial.InteractiveTutorialCordovaActivity;
import com.ciwong.epaper.modules.me.SearchDubActivity;
import com.ciwong.epaper.modules.me.bean.Clazz;
import com.ciwong.epaper.modules.me.bean.WorkContents;
import com.ciwong.epaper.modules.me.ui.AboutActivity;
import com.ciwong.epaper.modules.me.ui.AgreementActivity;
import com.ciwong.epaper.modules.me.ui.AgreementCancelActivity;
import com.ciwong.epaper.modules.me.ui.BindPhoneActivity;
import com.ciwong.epaper.modules.me.ui.BindPhoneDetailActivity;
import com.ciwong.epaper.modules.me.ui.BookTagActivity;
import com.ciwong.epaper.modules.me.ui.BookTagDictationActivity;
import com.ciwong.epaper.modules.me.ui.BuyServiceActivity;
import com.ciwong.epaper.modules.me.ui.ChooseSchoolActivity;
import com.ciwong.epaper.modules.me.ui.ClassListActivity;
import com.ciwong.epaper.modules.me.ui.CommonH5Activity;
import com.ciwong.epaper.modules.me.ui.DubVideoDetailActivity;
import com.ciwong.epaper.modules.me.ui.DubVideoListActivity;
import com.ciwong.epaper.modules.me.ui.DubVideoRecordDetailH5Activity;
import com.ciwong.epaper.modules.me.ui.DubVideoRecordListActivity;
import com.ciwong.epaper.modules.me.ui.DubVideoRecordingActivity;
import com.ciwong.epaper.modules.me.ui.FAQActivity;
import com.ciwong.epaper.modules.me.ui.FindH5Activity;
import com.ciwong.epaper.modules.me.ui.IssueRespActivity;
import com.ciwong.epaper.modules.me.ui.KeFuActivity;
import com.ciwong.epaper.modules.me.ui.LearnRecordH5Activity;
import com.ciwong.epaper.modules.me.ui.LoadingFileActivity;
import com.ciwong.epaper.modules.me.ui.MineGradeActivity;
import com.ciwong.epaper.modules.me.ui.MinePointActivity;
import com.ciwong.epaper.modules.me.ui.ModifyMyPhoneActivity;
import com.ciwong.epaper.modules.me.ui.ModifyPasswordActivity;
import com.ciwong.epaper.modules.me.ui.MyInfoActivity;
import com.ciwong.epaper.modules.me.ui.MyServicesActivity;
import com.ciwong.epaper.modules.me.ui.MyWrongQuesActivity;
import com.ciwong.epaper.modules.me.ui.NetTestActivity;
import com.ciwong.epaper.modules.me.ui.NewBookReadActivity;
import com.ciwong.epaper.modules.me.ui.OfflineBookActivity;
import com.ciwong.epaper.modules.me.ui.OfflineCatalogActivity;
import com.ciwong.epaper.modules.me.ui.OnlineServiceActivity;
import com.ciwong.epaper.modules.me.ui.PointRuleActivity;
import com.ciwong.epaper.modules.me.ui.ReadSettingActivity;
import com.ciwong.epaper.modules.me.ui.ReadTipColorActivity;
import com.ciwong.epaper.modules.me.ui.RegistRecodActivity;
import com.ciwong.epaper.modules.me.ui.RegistrationActivity;
import com.ciwong.epaper.modules.me.ui.ResetPasswordActivity;
import com.ciwong.epaper.modules.me.ui.ResourceCenterH5Activity;
import com.ciwong.epaper.modules.me.ui.ResourceCenterInnerH5Activity;
import com.ciwong.epaper.modules.me.ui.SendParentBuyActivity;
import com.ciwong.epaper.modules.me.ui.ServicesActivity;
import com.ciwong.epaper.modules.me.ui.SettingActivity;
import com.ciwong.epaper.modules.me.ui.StudyRecordActivity;
import com.ciwong.epaper.modules.me.ui.UpdateUserNameActivity;
import com.ciwong.epaper.modules.me.ui.WipeCacheActivity;
import com.ciwong.epaper.modules.me.ui.WrittenOffAccountActivity;
import com.ciwong.epaper.modules.me.ui.clazz.ChangeClassActivity;
import com.ciwong.epaper.modules.me.ui.clazz.ClassDetailActivity;
import com.ciwong.epaper.modules.me.ui.clazz.ClassMemberActivity;
import com.ciwong.epaper.modules.msg.bean.WorkContent;
import com.ciwong.epaper.modules.onlineanswer.OnlineAnswerCordovaActivity;
import com.ciwong.epaper.modules.onlineanswer.OnlineAnswerResultActivity;
import com.ciwong.epaper.modules.pad.contentprovider.LoginToken;
import com.ciwong.epaper.ui.ChooseCitySchoolActivity;
import com.ciwong.epaper.ui.MainActivity;
import com.ciwong.epaper.ui.NewLoginActivity;
import com.ciwong.epaper.ui.SearchSchoolActivity;
import com.ciwong.epaper.ui.SplashActivity;
import com.ciwong.epaper.ui.FirstAgreementActivity;
import com.ciwong.epaper.util.IntentFlag;
import com.ciwong.epaper.util.IntentValue;
import com.ciwong.epaper.util.RequestCode;
import com.ciwong.epaper.util.ZipPackageUtils;
import com.ciwong.epaper.util.download.DownLoadInfo;
import com.ciwong.epaper.utils.GsonUtil;
import com.ciwong.eventbus.EventBus;
import com.ciwong.libs.utils.CWLog;
import com.ciwong.libs.utils.NetworkUtils;
import com.ciwong.mobilelib.i.BaseCallBack;
import com.ciwong.mobilelib.ui.BaseActivity;
import com.ciwong.mobilelib.ui.BrowserActivity;
import com.ciwong.mobilelib.utils.BaseActivityManager;
import com.ciwong.mobilelib.utils.BaseIntentFlag;
import com.ciwong.mobilelib.utils.BaseJumpManager;
import com.ciwong.mobilelib.utils.ToastUtil;
import com.ciwong.mobilepay.bean.PayDetail;
import com.ciwong.mobilepay.ui.EMainActivity;

import java.util.ArrayList;

/**
 * 我 跳转管理类
 *
 * @author bin
 * @version ciwong v.1.0 2015/7/23 19:34
 * @since ciwong v.1.0
 */
public class MeJumpManager extends BaseJumpManager {

    /**
     * 跳转到加入班级界面
     *
     * @param goBackId
     * @param context
     * @param jumpType {@link IntentValue.JumpToJoinClassType}
     */
    public static void jumpToJoinClassActivity(int goBackId, Activity context,
                                               int jumpType, int requestCode) {
//        Intent intent = getBaseIntent(goBackId, context,
//                JoinClassActivity.class);
        Intent intent = getBaseIntent(goBackId, context,
                ChangeClassActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, jumpType);

        context.startActivityForResult(intent, requestCode);

    }

    /**
     * 跳转到选择学校界面
     *
     * @param goBackId    启动activity
     * @param context     将要打开的activity
     * @param type        跳转类型
     * @param requestCode 返回码
     */
    public static void jumpToChooseSchool(int goBackId, Activity context,
                                          int type, int requestCode) {
        Intent intent = getBaseIntent(goBackId, context,
                ChooseSchoolActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, type);
        context.startActivityForResult(intent, requestCode);
    }


    /**
     * 跳转到意见反馈
     *
     * @param goBackId 启动activity
     * @param context
     */
    public static void jumpToIssueRespActivity(int goBackId, Activity context) {
        Intent intent = getBaseIntent(goBackId, context,
                IssueRespActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳转到标签书籍 页面
     *
     * @param goBackId 启动activity
     * @param context
     */
    public static void jumpToBookTagActivity(int goBackId, int bookmarkId, String bookMarkTitle, Activity context) {
        Intent intent = getBaseIntent(goBackId, context,
                BookTagActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_BOOKMARK, bookmarkId);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, bookMarkTitle);
        context.startActivity(intent);
    }

    /**
     * 跳转到报听写标签书籍页面
     *
     * @param goBackId 启动activity
     * @param context
     */
    public static void jumpToBookTagDictationActivity(int goBackId, int bookmarkId, String bookMarkTitle, Activity context) {
        Intent intent = getBaseIntent(goBackId, context,
                BookTagDictationActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_BOOKMARK, bookmarkId);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, bookMarkTitle);
        context.startActivity(intent);
    }


    public static void jumpTNewBookReadActivity(int goBackId, int bookmarkId, String bookMarkTitle, Activity context) {
        Intent intent = getBaseIntent(goBackId, context,
                NewBookReadActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_BOOKMARK, bookmarkId);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, bookMarkTitle);
        context.startActivity(intent);
    }

    /**
     * 跳转服务列表界面/微商城
     *
     * @param goBackId    返回按钮的文字id
     * @param act         启动activity
     * @param requestCode 请求码
     */
    public static void jumpServices(int goBackId, Activity act, int requestCode) {
        Intent intent = getBaseIntent(goBackId, act, ServicesActivity.class);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转服务列表界面
     *
     * @param goBackId    返回按钮的文字id
     * @param act         启动activity
     * @param fragment    Fragment对象
     * @param requestCode 请求码
     */
    public static void jumpServices(int goBackId, Activity act,
                                    Fragment fragment, int requestCode) {
        Intent intent = getBaseIntent(goBackId, act, ServicesActivity.class);
        fragment.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转到我的服务详情列表界面
     *
     * @param goBackId    返回按钮的文字id
     * @param act         启动activity
     * @param requestCode 请求码
     */
    public static void jumpToMyServices(int goBackId, Activity act,
                                        int requestCode) {
        Intent intent = getBaseIntent(goBackId, act, MyServicesActivity.class);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转到正在下载页面
     *
     * @param context 上下文
     * @param backId  返回键字符资源
     */
    public static void jumpToLoadingFiles(Activity context, int backId) {
        Intent mIntent = getBaseIntent(backId, context,
                LoadingFileActivity.class);
        // mIntent.putExtra(BaseIntentFlag.INTENT_FLAG_TYPE,
        // FileConsts.LIST_ALL);
        context.startActivity(mIntent);
    }

    /**
     * 跳转到离线资源页面
     *
     * @param context 上下文
     * @param backId  返回键字符资源
     */
    public static void jumpToOfflineFiles(Activity context,
                                          ArrayList<DownLoadInfo> list, String bookName, int backId, int serviceId) {
        Intent mIntent = getBaseIntent(backId, context,
                OfflineCatalogActivity.class);
        mIntent.putExtra(BaseIntentFlag.INTENT_FLAG_OBJ_LIST, list);
        mIntent.putExtra(BaseIntentFlag.INTENT_FLAG_STR, bookName);

        mIntent.putExtra(IntentFlag.INTENT_FLAG_SERVICE_ID, serviceId);

        context.startActivity(mIntent);
    }

    /**
     * 跳转到离线资源页面
     *
     * @param context 上下文
     * @param backId  返回键字符资源
     */
    public static void jumpToOfflineBook(Activity context, int backId, int serviceId) {
        Intent mIntent = getBaseIntent(backId, context,
                OfflineBookActivity.class);
        mIntent.putExtra(IntentFlag.INTENT_FLAG_SERVICE_ID, serviceId);
        context.startActivity(mIntent);
    }

    /**
     * 跳转到学习记录
     *
     * @param isOnline    是否线上作业
     * @param context
     * @param backId
     * @param requestCode
     */
    public static void jumpToStudyRecord(int isOnline, Activity context,
                                         int backId, int requestCode) {
        Intent intent = getBaseIntent(backId, context,
                StudyRecordActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, isOnline);
        context.startActivityForResult(intent, requestCode);
    }

    /**
     * @param type        类型，举例：
     * @param context
     * @param backId      R.string.go_back
     * @param requestCode 没有则传-1；
     * @param url         链接地址,如果不传，则默认进入学习记录的列表
     * @param title       标题
     */
    public static void jumpToStudyRecordH5Activity(int type, Activity context,
                                                   int backId, int requestCode, String url, String title, int doWorkType) {
        context.sendBroadcast(new Intent(IntentFlag.INTENT_FLAG_HOMEWORK_VIEW_DETAILS));
        Intent intent = getBaseIntent(backId, context,
                LearnRecordH5Activity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, type);
        intent.putExtra(IntentFlag.INTENT_FLAG_URL, url);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, title);
        intent.putExtra(IntentFlag.INTENT_FLAG_DO_WORK_TYPE, doWorkType);
        context.startActivityForResult(intent, requestCode);
    }

    /**
     * @param backId
     * @param context
     * @param contextId
     * @param title     moduleId = 5(单元测试)/7(时文)/10(同步跟读)/15(听说模考)/30(报听写)/126(视频讲解)/124(线上作答)
     */
    public static void jumpToRankH5Activity(int backId, Activity context, String contextId, String title) {
        Intent intent = getBaseIntent(backId, context, RankingActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_CONTENTID, contextId);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, title);
//        intent.putExtra(IntentFlag.INTENT_FLAG_ID, moduleId);
        context.startActivityForResult(intent, EpaperConstant.REQUEST_CODE_TO_RANK_PAGE);
    }

    public static void jumpToTimeNewsH5Activity(int goBackId, Activity act, DownLoadInfo downLoadInfo, Module module, int position) {

        Intent intent = getBaseIntent(goBackId, act, TimeNewsActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, module);
        intent.putExtra(IntentFlag.INTENT_FLAG_DOWNLOAD_INFO, downLoadInfo);
        intent.putExtra(IntentFlag.INTENT_FLAG_POSITION, position);
        intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
        act.startActivity(intent);

    }

    public static void jumpToMineGrade(int goBackId, Activity act) {

        Intent intent = getBaseIntent(goBackId, act, MineGradeActivity.class);
        act.startActivity(intent);

    }

    /**
     * @param goBackId
     * @param act
     */
    public static void jumpToMinePiontH5Activity(int goBackId, Activity act) {

        Intent intent = getBaseIntent(goBackId, act, MinePointActivity.class);
        act.startActivity(intent);

    }

    /**
     * 积分规则
     *
     * @param goBackId
     * @param act
     */
    public static void jumpToPiontRuleH5Activity(int goBackId, Activity act/*,String url, String title*/) {

        Intent intent = getBaseIntent(goBackId, act, PointRuleActivity.class);
        act.startActivity(intent);

    }


    /**
     * 跳转到设置
     *
     * @param context
     * @param goBack
     * @param reqCode
     */
    public static void jumpToSetting(Activity context, int goBack, int reqCode, int type) {
        Intent it = getBaseIntent(goBack, context, SettingActivity.class);
        it.putExtra(IntentFlag.INTENT_FLAG_SETTING_JUMP_SOURCE, type);
        context.startActivityForResult(it, reqCode);
    }

    /**
     * 跳转清除缓存
     *
     * @param context
     * @param goBack
     * @param reqCode
     */
    public static void jumpToWipeCache(Activity context, int goBack, int reqCode) {
        Intent it = getBaseIntent(goBack, context, WipeCacheActivity.class);
        context.startActivityForResult(it, reqCode);
    }

    /**
     * 跳转客服
     *
     * @param context
     * @param goBack
     */
    public static void jumpToKeFu(Activity context, int goBack) {
        Intent it = getBaseIntent(goBack, context, KeFuActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转通知家长购买
     *
     * @param context
     * @param goBack
     */
    public static void jumpSendParentBuyActivity(Activity context, int goBack) {
        Intent it = getBaseIntent(goBack, context, SendParentBuyActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转到跟读设置
     *
     * @param context
     * @param goBack
     * @param isDialog 是否显示为Dialog
     */
    public static void jumpToReadSetting(Activity context, int goBack,
                                         boolean isDialog) {
        Intent it = getBaseIntent(goBack, context, ReadSettingActivity.class);
        it.putExtra(IntentFlag.INTENT_FLAG_ACTION, isDialog);
        context.startActivity(it);
    }


    /**
     * 跳转到跟读设置
     *
     * @param context
     * @param goBack  是否显示为Dialog
     */
    public static void jumpToReadSetting(Activity context, int goBack,
                                         int requestCode) {
        Intent it = getBaseIntent(goBack, context, ReadSettingActivity.class);
        context.startActivityForResult(it, requestCode);
    }

    /**
     * 跳转到跟读提示文字颜色界面
     *
     * @param context
     * @param goBack
     */
    public static void jumpToReadTipColor(Activity context, int goBack) {
        Intent it = getBaseIntent(goBack, context, ReadTipColorActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转到登录
     *
     * @param context
     */
    public static void jumpToLogin(Activity context) {
        Intent it = getBaseIntent(0, context, NewLoginActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转到登录
     *
     * @param context
     */
    public static void jumpToSplash(Activity context) {
        Intent it = getBaseIntent(0, context, SplashActivity.class);
        it.putExtra(LoginToken.ACTION_KEY_RELOGIN, true);
        context.startActivity(it);
    }

    /**
     * 跳转到关于我们
     *
     * @param context
     */
    public static void jumpToAbout(Activity context) {
        Intent it = getBaseIntent(R.string.go_back, context,
                AboutActivity.class);
        context.startActivity(it);
    }

    /**
     * 跳转至隐私协议保护声明
     */
    public static void jumpToAreementCancel(Activity act, int goBackId, String url,
                                            String titile) {
        Intent baseIntent = getBaseIntent(goBackId, act, AgreementCancelActivity.class);
        baseIntent.putExtra(IntentFlag.INTENT_FLAG_AGREEMENT_CANCEL_URL, url);
        baseIntent.putExtra(IntentFlag.INTENT_FLAG_TITLE, titile);
        act.startActivity(baseIntent);

    }

    /**
     * 跳转到在线客服浏览器
     *
     * @param act
     * @param goBackId
     * @param url
     * @param title
     */
    public static void jumpToOnlineService(Activity act, int goBackId,
                                           String url, String title) {
        Intent intent = getBaseIntent(goBackId, act,
                OnlineServiceActivity.class);
//        intent.putExtra(OnlineServiceActivity.IntentString.INTENT_STRING_URL, url);
//        intent.putExtra(OnlineServiceActivity.IntentString.INTENT_STRING_TITLE, title);
        intent.putExtra(IntentFlag.INTENT_FLAG_URL, url);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, title);
        act.startActivity(intent);
    }

    /**
     * 跳转到登陆页面
     */
    public static void jumpToLogin2(Activity act, int goBackId, String mobile, String psw, int loginType) {
        Intent intent = getBaseIntent(goBackId, act, NewLoginActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_STR, mobile);
        intent.putExtra(IntentFlag.INTENT_FLAG_PSW, psw);
        intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, loginType);
        act.startActivityForResult(intent, NewLoginActivity.FOR_LOGIN);
    }


    /**
     * 跳转到个人信息界面
     *
     * @param act
     * @param goBackId
     * @param requestCode
     */
    public static void jumpToMyInfo(Fragment act, int goBackId, int requestCode) {
        Intent intent = getBaseIntent(goBackId, act.getActivity(), MyInfoActivity.class);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转到更换手机号界面
     *
     * @param act
     * @param goBackId
     * @param
     */
    public static void jumpToModifyPhone(Activity act, int goBackId, String phoneNumber) {
        Intent intent = getBaseIntent(goBackId, act, ModifyMyPhoneActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_STR, phoneNumber);
        act.startActivity(intent);
    }

    /**
     * 跳转到重置密码页面
     *
     * @param activity
     * @param goBackId
     * @param phoneNumber
     * @param verity_code
     */

    public static void jumpResetPasswordActivity(Activity activity, int goBackId, String phoneNumber, String verity_code) {
        Intent intent = getBaseIntent(goBackId, activity, ResetPasswordActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_STR, phoneNumber);
        intent.putExtra(IntentFlag.INTENT_FLAG_SMS, verity_code);
        activity.startActivity(intent);


    }

    /**
     * 跳转到班级列表界面
     *
     * @param act
     * @param goBackId
     * @param requestCode
     */
    public static void jumpToClassList(Activity act, int goBackId, int jumpType,
                                       int requestCode, String phoneNum, Clazz clazz) {
        Intent intent = getBaseIntent(goBackId, act, ClassListActivity.class);

        if (null != clazz) {
            intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, clazz);
        }

        intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, jumpType);
        if (null != phoneNum) {
            intent.putExtra(IntentFlag.INTENT_FLAG_STR, phoneNum);
        }
        act.startActivityForResult(intent, requestCode);

    }

    /**
     * 跳转到班级详情界面
     *
     * @param act
     * @param goBackId
     */
    public static void jumpToClassDetail(Activity act, int goBackId, Clazz clazz
            , int requestCode) {
        Intent intent = getBaseIntent(goBackId, act, ClassDetailActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, clazz);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转到班级成员变量
     *
     * @param act
     * @param goBackId
     */
    public static void jumpToClassMember(Activity act, int goBackId, Clazz clazz
    ) {
        Intent intent = getBaseIntent(goBackId, act, ClassMemberActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, clazz);
        act.startActivity(intent);
    }

    /**
     * 跳转到更换班级界面
     *
     * @param act
     * @param goBackId
     */
    public static void jumpToChangeClass(Activity act, int goBackId, int jumpType, int requestCode, Clazz clazz) {
        Intent intent = getBaseIntent(goBackId, act, ChangeClassActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, clazz);
        intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, jumpType);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转到我的错题
     *
     * @param act
     * @param goBackId
     * @param answer
     */
    public static void jumpToMyWrongQues(Activity act, int goBackId,
                                         Answer answer) {
        Intent intent = getBaseIntent(goBackId, act, MyWrongQuesActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, answer);
        act.startActivity(intent);
    }

    /**
     * 跳转到老师点评界面
     *
     * @param act
     * @param goBackId
     * @param answer
     */
    public static void jumpToRemarkActivity(Activity act, int goBackId,
                                            Answer answer) {
        Intent intent = getBaseIntent(goBackId, act,
                TeacherRemarkActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, answer);
        act.startActivity(intent);
    }

    /**
     * 跳转到修改名界面
     *
     * @param act
     * @param goBackId
     * @param requestCode
     */
    public static void jumpToUpdateUserNameActivity(Activity act, int goBackId,
                                                    int requestCode) {
        Intent intent = getBaseIntent(goBackId, act,
                UpdateUserNameActivity.class);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转到修改密码界面
     *
     * @param goBackId 返回按钮的文字id
     * @param activity 启动Activity
     */
    public static void jumpToModifyPassword(int goBackId, Activity activity) {
        Intent intent = getBaseIntent(goBackId, activity,
                ModifyPasswordActivity.class);
        activity.startActivity(intent);
    }

    /**
     * 跳转到服务介绍界面
     *
     * @param act       上下文
     * @param goBackId  返回按钮
     * @param serviceId 服务ID
     * @param request   请求码
     */
    public static void jumpBuyService(Activity act, int goBackId, int serviceId, int sign, int request, String tips) {
        Intent intent = getBaseIntent(goBackId, act, BuyServiceActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_ID, serviceId);
        intent.putExtra(IntentFlag.INTENT_FLAG_SIGN, sign);
        intent.putExtra(IntentFlag.INTENT_FLAG_TIP, tips);
        intent.putExtra(IntentFlag.INTENT_FLAG_REQUESTCODE, request);
        act.startActivityForResult(intent, request);
    }

    /**
     * 跳转到服务介绍界面
     *
     * @param act      上下文
     * @param fragment Fragment对象
     * @param goBackId 返回按钮
     * @param request  返回码
     */
    public static void jumpBuyService(Activity act, Fragment fragment, int goBackId, int serviceId, int request) {
        Intent in = getBaseIntent(goBackId, act, BuyServiceActivity.class);
        in.putExtra(IntentFlag.INTENT_FLAG_ID, serviceId);
        fragment.startActivityForResult(in, request);
    }


    /**
     * 跳转验证手机验证码页面
     *
     * @param goBackId    返回按钮
     * @param act         上下文
     * @param phonenumber 手机号
     */
    public static void jumpToBindPhoneDetailActivity(int goBackId, Activity act, String phonenumber, int TEMPLATE) {
        if (!act.isFinishing()) {
            Intent intent = getBaseIntent(goBackId, act, BindPhoneDetailActivity.class);
            intent.putExtra(IntentFlag.INTENT_FLAG_STR, phonenumber);
            intent.putExtra(IntentFlag.INTENT_FLAG_ID, TEMPLATE);
            act.startActivity(intent);

        }
    }

    public static void jumpToCallPhone(int goBackId, Activity act, String phone) {
        if (!act.isFinishing()) {
            try {
                Intent intent = new Intent(Intent.ACTION_DIAL);
                intent.putExtra(BaseJumpManager.INTENT_FLAG_SOURCE, true);
                intent.putExtra(GO_BACK_ID, goBackId);
                intent.setData(Uri.parse("tel:" + phone));
                act.startActivity(intent);
            } catch (ActivityNotFoundException e) {
                CWLog.e("MeJumpManager", "手机上没有安装拨号软件");
            }
        }
    }

    /**
     * 跳转绑定手机号页面
     *
     * @param goBackId    返回按钮
     * @param act         上下文
     * @param phonenumber
     * @param id          标志不同来源
     *                    1忘记密码   2.绑定手机号 3.注册
     */
    public static void jumpToBindPhoneActivity(int goBackId, Activity act, String phonenumber, String id) {
        if (!act.isFinishing()) {
            Intent intent = getBaseIntent(goBackId, act, BindPhoneActivity.class);
            intent.putExtra(IntentFlag.INTENT_FLAG_STR, phonenumber);
            intent.putExtra(IntentFlag.INTENT_FLAG_ID, id);
            act.startActivity(intent);

        }
    }

    /**
     * 跳转绑定手机号页面
     *
     * @param goBackId    返回按钮
     * @param act         上下文
     * @param phonenumber
     * @param id          标志不同来源
     *                    1忘记密码   2.绑定手机号 3.注册
     */
    public static void jumpToBindPhoneActivity(int goBackId, Activity act, String phonenumber, String id, int type, int requestcode) {
        if (!act.isFinishing()) {
            Intent intent = getBaseIntent(goBackId, act, BindPhoneActivity.class);
            intent.putExtra(IntentFlag.INTENT_FLAG_STR, phonenumber);
            intent.putExtra(IntentFlag.INTENT_FLAG_ID, id);
            intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, type);
            act.startActivityForResult(intent, requestcode);
        }
    }


    /**
     * 跳转到报名系统
     *
     * @param act
     */
    public static void jumpToRegistrationH5(int goBackId, int theamId, Activity act) {
        Intent intent = getBaseIntent(goBackId, act, RegistrationActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, theamId);
        act.startActivity(intent);
    }

    /**
     * 参赛记录
     *
     * @param act
     */
    public static void jumpToRegistRecodH5(int goBackId, int themeId, Activity act) {
        Intent intent = getBaseIntent(goBackId, act, RegistRecodActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, themeId);
        act.startActivity(intent);
    }

    /**
     * 参赛记录
     *
     * @param act
     */
    public static void jumpToPay(int goBackId, PayDetail payDetail, Activity act, int requestCode) {
        Intent intent = getBaseIntent(goBackId, act, EMainActivity.class);
        intent.putExtra("PAY_DETAIL", payDetail);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 跳转在线答题
     *  课后作业列表，点击线上作答
     * @param mActivity
     * @param moduleContent
     * @param module
     * @param downLoadInfo
     * @param position
     * @param from
     * @param workId
     * @param effectivDate
     * @param contentId
     * @param requestCode
     * @param serviceId
     * @param workContent
     * @param workType
     */
    public static void jumpToNewOnlineAnswerCordovaActivity(final Activity mActivity,
                                                            final ModuleContent moduleContent,
                                                            final Module module,
                                                            final DownLoadInfo downLoadInfo,
                                                            final int position,
                                                            final int from,
                                                            final String workId,
                                                            final long effectivDate,
                                                            final int contentId,
                                                            final int requestCode,
                                                            final int serviceId,
                                                            final WorkContents workContent,
                                                            final int workType) {

        ZipPackageUtils.checkHtmlFileNeedDownload(mActivity, new BaseCallBack() {

            @Override
            public void success(Object data) {
                super.success(data);
                EventBus.getDefault().post(new HideDownloadDialogBean(true));

                if (isContainsActivityInStack(NewWorkOnlineAnswerCordovaActivity.class)) {
                    return;
                }
                Intent baseIntent = getBaseIntent(0, mActivity, NewWorkOnlineAnswerCordovaActivity.class);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_OBJ, moduleContent);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_MODULE, module);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_DOWNLOAD_INFO, downLoadInfo);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_H5_PAGE_TYPE_SOURCE, from);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_WORK_ID, workId);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_WORK_EFFECTIV_TIME, effectivDate);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_ID, contentId);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_POSITION, position);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_SERVICE_ID, serviceId);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_CHECK_RESOURCE, workContent != null ? workContent.getCheckedResource() : "");
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_WORK_SCORE, workContent != null ? (workType == 1 ? workContent.getErrorWorkScore() : workContent.getWorkScore()) : 0);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_ERROR_RESOURCE, workContent != null ? workContent.getErrorResource() : "");
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_DO_WORK_ID, workContent != null ? workContent.getDoWorkId() : "");
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_DO_WORK_TYPE, workType);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_WORK_CONTENTS, workContent);
                mActivity.startActivityForResult(baseIntent, requestCode);
            }

            @Override
            public void failed(int errorCode, Object data) {
                EventBus.getDefault().post(new HideDownloadDialogBean(true));
            }

            @Override
            public void failed(Object data) {
                EventBus.getDefault().post(new HideDownloadDialogBean(true));

            }
        });

    }

    /**
     * @param mActivity
     * @param downLoadInfo
     * @param from         1:作业进来，2：书桌进来
     */
    public static void jumpToOnlineAnswerCordovaActivity(final Activity mActivity,
                                                         final ModuleContent moduleContent,
                                                         final Module module,
                                                         final DownLoadInfo downLoadInfo,
                                                         final int position,
                                                         final int from,
                                                         final String workId,
                                                         final long effectivDate,
                                                         final int contentId,
                                                         final int requestCode,
                                                         final int serviceId,
                                                         final WorkContents workContent,
                                                         final int workType) {

        ZipPackageUtils.checkHtmlFileNeedDownload(mActivity, new BaseCallBack() {

            @Override
            public void success(Object data) {
                super.success(data);
                EventBus.getDefault().post(new HideDownloadDialogBean(true));

                if (isContainsActivityInStack(OnlineAnswerCordovaActivity.class)) {
                    return;
                }
                Intent baseIntent = getBaseIntent(0, mActivity, OnlineAnswerCordovaActivity.class);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_OBJ, moduleContent);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_MODULE, module);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_DOWNLOAD_INFO, downLoadInfo);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_H5_PAGE_TYPE_SOURCE, from);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_WORK_ID, workId);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_WORK_EFFECTIV_TIME, effectivDate);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_ID, contentId);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_POSITION, position);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_SERVICE_ID, serviceId);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_CHECK_RESOURCE, workContent != null ? workContent.getCheckedResource() : "");
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_WORK_SCORE, workContent != null ? (workType == 1 ? workContent.getErrorWorkScore() : workContent.getWorkScore()) : 0);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_ERROR_RESOURCE, workContent != null ? workContent.getErrorResource() : "");
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_DO_WORK_ID, workContent != null ? workContent.getDoWorkId() : "");
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_DO_WORK_TYPE, workType);
                baseIntent.putExtra(IntentFlag.INTENT_FLAG_WORK_CONTENTS, workContent);
                mActivity.startActivityForResult(baseIntent, requestCode);
            }

            @Override
            public void failed(int errorCode, Object data) {
                EventBus.getDefault().post(new HideDownloadDialogBean(true));
            }

            @Override
            public void failed(Object data) {
                EventBus.getDefault().post(new HideDownloadDialogBean(true));

            }
        });

    }

    public static void jumpToOnlineAnswerCordovaActivity2(final BaseActivity mActivity, final ModuleContent moduleContent, final Module module, final DownLoadInfo downLoadInfo, final int position, final int serviceId, final int from, final String workId, final int contentId, final int requestCode) {

        ZipPackageUtils.checkHtmlFileNeedDownload(mActivity, new BaseCallBack() {
            @Override
            public void success(Object data) {
                super.success(data);
                EventBus.getDefault().post(new HideDownloadDialogBean(true));


                if (isContainsActivityInStack(OnlineAnswerCordovaActivity.class)) {
                    return;
                }


                Intent onlineAnswerCordovaIntent = getBaseIntent(0, mActivity, OnlineAnswerCordovaActivity.class);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_OBJ, moduleContent);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_MODULE, module);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_DOWNLOAD_INFO, downLoadInfo);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_H5_PAGE_TYPE_SOURCE, from);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_ID, contentId);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_WORK_ID, workId);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_POSITION, position);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_SERVICE_ID, serviceId);
                onlineAnswerCordovaIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
                mActivity.startActivityForResult(onlineAnswerCordovaIntent, requestCode);

            }

            @Override
            public void failed(int errorCode, Object data) {
                EventBus.getDefault().post(new HideDownloadDialogBean(true));
            }

            @Override
            public void failed(Object data) {
                EventBus.getDefault().post(new HideDownloadDialogBean(true));
            }
        });

    }

    /**
     * @param activity
     * @param OnlineAnswerFrom
     * @param workLong
     * @param doWorkId
     * @param workScore        总分
     * @param actualScore      得分
     * @param isSubjective
     * @param contentId
     */
    public static void jumpToOnlineAnswerResultActivity(Activity activity, int OnlineAnswerFrom, int workLong, String doWorkId, float workScore, float actualScore, boolean isSubjective, String contentId, DownLoadInfo downLoadInfo, int doWorkType, long effectivDate, WorkContents workContents, long returnWorkLong) {
        Intent intent = getBaseIntent(0, activity, OnlineAnswerResultActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, OnlineAnswerFrom);
        intent.putExtra(IntentFlag.INTENT_FLAG_WORK_TIME, workLong);
        intent.putExtra(IntentFlag.INTENT_FLAG_DO_WORK_ID, doWorkId);
        intent.putExtra(IntentFlag.INTENT_FLAG_WORK_SCORE, workScore);
        intent.putExtra(IntentFlag.INTENT_FLAG_ACTUAL_SCORE, actualScore);
        intent.putExtra(IntentFlag.INTENT_FLAG_ID, contentId);
        intent.putExtra(IntentFlag.INTENT_FLAG_SUBJECTIVE, isSubjective);
        intent.putExtra(IntentFlag.INTENT_FLAG_DOWNLOAD_INFO, downLoadInfo);
        intent.putExtra(IntentFlag.INTENT_FLAG_DO_WORK_TYPE, doWorkType);
        intent.putExtra(IntentFlag.INTENT_FLAG_WORK_EFFECTIV_TIME, effectivDate);
        intent.putExtra(IntentFlag.INTENT_FLAG_WORK_CONTENTS, workContents);
        intent.putExtra(IntentFlag.INTENT_FLAG_RETURN_WORK_LONG, returnWorkLong);
        activity.startActivityForResult(intent, RequestCode.HomeWorkFragmentResquestCode.REQ_ONLINE_ANSWER);
    }

    public static void jumpToExamCordovaActivity(Activity activity, int from, String workId, int serviceType, WorkContents workContent, int requestCode, long effectiveDate) {
        Intent examCordovaIntent = getBaseIntent(0, activity, ExamActivity.class);
        examCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_H5_PAGE_TYPE_SOURCE, from);
        examCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_WORK_CONTENT, workContent);
        examCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_WORK_ID, workId);
        examCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_SERVICE_ID, serviceType);
        examCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_WORK_EFFECTIV_TIME, effectiveDate);
        activity.startActivityForResult(examCordovaIntent, requestCode);
    }

    /**
     * 跳转到常见问题
     *
     * @param goBackId
     * @param context
     * @param url
     * @param title
     */
    public static void jumpFAQActivity(int goBackId, Activity context, String url, String title) {
        Intent intent = getBaseIntent(goBackId, context, FAQActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_URL, url);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, title);
//        intent.putExtra(BrowserActivity.IntentString.INTENT_STRING_URL, url);
//        intent.putExtra(BrowserActivity.IntentString.INTENT_STRING_TITLE, title);
        context.startActivity(intent);
    }

    /**
     * 跳转到注销账号
     *
     * @param goBackId
     * @param context
     * @param url
     * @param title
     */
    public static void jumpWrittenOffActivity(int goBackId, Activity context, String url, String title) {
        Intent intent = getBaseIntent(goBackId, context, WrittenOffAccountActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_URL, url);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, title);
        context.startActivity(intent);
    }

    /**
     * 跳转到隐私协议
     *
     * @param goBackId
     * @param context
     * @param url
     * @param title
     */
    public static void jumpAgreementActivity(int goBackId, Activity context, String url, String title, String action) {
        Intent intent = getBaseIntent(goBackId, context, AgreementActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_URL, url);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, title);
        intent.putExtra(IntentFlag.INTENT_FLAG_ACTION, action);
        context.startActivity(intent);
    }


    public static void jumpToChooseCitySchoolActivity(int goBackId, Activity context, int requestCode) {
        Intent intent = getBaseIntent(goBackId, context, ChooseCitySchoolActivity.class);
        context.startActivityForResult(intent, requestCode);
    }

    public static void jumpToSearchSchool(int goBackId, String schoolArea, String areaStr, Activity context, int requestCode) {
        Intent intent = getBaseIntent(goBackId, context, SearchSchoolActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_SCHOOL_AREA, schoolArea);
        intent.putExtra(IntentFlag.INTENT_FLAG_AREASTR, areaStr);
        context.startActivityForResult(intent, requestCode);
    }

    /**
     * 设置页面跳转到个人信息界面
     *
     * @param act
     * @param goBackId
     * @param requestCode
     */
    public static void jumpToMyInfo(Activity act, int goBackId, int requestCode) {
        Intent intent = getBaseIntent(goBackId, act, MyInfoActivity.class);
        act.startActivityForResult(intent, requestCode);
    }

    /**
     * 设置页面跳转到
     *
     * @param act
     * @param goBackId
     * @param
     */
    public static void jumpToNetAct(Activity act, int goBackId) {
        Intent intent = getBaseIntent(goBackId, act, NetTestActivity.class);
        act.startActivity(intent);
    }

    /**
     * 跳到MeFragment中的学习设置页面
     *
     * @param context
     * @param goBack
     * @param reqCode
     * @param type
     */
    public static void jumpToMainActivity(Activity context, int goBack, int reqCode, int type) {
        Intent it = getBaseIntent(goBack, context, MainActivity.class);
        it.putExtra(IntentFlag.INTENT_FLAG_SETTING_JUMP_SOURCE, type);
        context.startActivityForResult(it, reqCode);
    }

    /**
     * @param context
     * @param backId  R.string.go_back
     * @param title   标题
     */
    public static void jumpToResourseCenterH5Activity(Activity context,
                                                      int backId, String title) {
        Intent intent = getBaseIntent(backId, context,
                ResourceCenterH5Activity.class);
//        intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, type);
//        intent.putExtra(, IntentFlag.INTENT_FLAG_URLurl);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, title);
        context.startActivity(intent);
    }

    /**
     * @param context
     * @param backId  R.string.go_back
     * @param title   标题
     */
    public static void jumpToFindH5Activity(Activity context,
                                            int backId, String title) {
        Intent intent = getBaseIntent(backId, context,
                FindH5Activity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, title);
        context.startActivity(intent);
    }

    /**
     * @param context
     * @param backId  R.string.go_back
     * @param title   标题
     */
    public static void jumpToCommonH5Activity(Activity context,
                                              int backId, String title, String url) {
        Intent intent = getBaseIntent(backId, context,
                CommonH5Activity.class);
//        url = "https://h5.zxx.edu.cn/";
//        intent.putExtra(IntentFlag.INTENT_FLAG_TYPE, type);
        intent.putExtra(IntentFlag.INTENT_FLAG_URL, url);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, title);
        context.startActivity(intent);
    }

    /**
     * 资源中心的内部页面
     *
     * @param goBackId
     * @param act
     * @param url
     */

    public static void jumpToResourseCenterInnerH5Activity(int goBackId, Activity act, String url/*, String title*/) {

        Intent intent = getBaseIntent(goBackId, act, ResourceCenterInnerH5Activity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_URL, url);
        act.startActivity(intent);

    }

    private static boolean isContainsActivityInStack(Class clazz) {
        if (clazz != null) {
            return BaseActivityManager.getInstance().isContainsActivityInStack(clazz);
        }
        return false;
    }

    /**
     * 跳转互动教程
     *
     * @param mActivity
     * @param moduleContent
     * @param module
     * @param downLoadInfo
     * @param position
     * @param serviceId
     * @param from
     * @param workId
     * @param contentId
     * @param requestCode
     */
    public static void jumpToInteractiveTutorialCordovaActivity(final BaseActivity mActivity, final ModuleContent moduleContent, final Module module, final DownLoadInfo downLoadInfo, final int position, final int serviceId, final int from, final String workId, final int contentId, final int requestCode) {

        ZipPackageUtils.checkHtmlFileNeedDownload(mActivity, new BaseCallBack() {
            @Override
            public void success(Object data) {
                super.success(data);
                EventBus.getDefault().post(new HideDownloadDialogBean(true));


                if (isContainsActivityInStack(InteractiveTutorialCordovaActivity.class)) {
                    return;
                }

                Log.e("CordovaActivity"," moduleContent "+ GsonUtil.toJson(moduleContent) + " downLoadInfo "+ GsonUtil.toJson(downLoadInfo)+ " module "+ GsonUtil.toJson(module)+" from "+from+" workId "+workId+" contentId "+contentId+" requestCode "+requestCode +" position = "+position +" serviceId = "+serviceId);


                Intent onlineAnswerCordovaIntent = getBaseIntent(0, mActivity, InteractiveTutorialCordovaActivity.class);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_OBJ, moduleContent);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_MODULE, module);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_DOWNLOAD_INFO, downLoadInfo);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_H5_PAGE_TYPE_SOURCE, from);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_ID, contentId);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_WORK_ID, workId);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_POSITION, position);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_SERVICE_ID, serviceId);
                onlineAnswerCordovaIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
                mActivity.startActivityForResult(onlineAnswerCordovaIntent, requestCode);

            }

            @Override
            public void failed(int errorCode, Object data) {
                try {
                    EventBus.getDefault().post(new HideDownloadDialogBean(true));

                    if (!NetworkUtils.isOnline()) {
                        ToastUtil.INSTANCE.toastCenterNoNetError();
                    }
                } catch (Exception e) {

                }
            }

            @Override
            public void failed(Object data) {
                try {
                    EventBus.getDefault().post(new HideDownloadDialogBean(true));

                    if (!NetworkUtils.isOnline()) {
                        ToastUtil.INSTANCE.toastCenterNoNetError();
                    }
                } catch (Exception e) {

                }
            }
        });

    }


    public static void jumpToNewBookDetailH5Activity(final BaseActivity mActivity, final ModuleContent moduleContent, final Module module, final DownLoadInfo downLoadInfo, final int position, final int serviceId, final int from, final String workId, final int contentId, final int requestCode) {

        ZipPackageUtils.checkHtmlFileNeedDownload(mActivity, new BaseCallBack() {
            @Override
            public void success(Object data) {
                super.success(data);
                EventBus.getDefault().post(new HideDownloadDialogBean(true));


                if (isContainsActivityInStack(InteractiveTutorialCordovaActivity.class)) {
                    return;
                }

                Log.e("CordovaActivity"," moduleContent "+ GsonUtil.toJson(moduleContent) + " downLoadInfo "+ GsonUtil.toJson(downLoadInfo)+" from "+from+" workId "+workId+" contentId "+contentId+" requestCode "+requestCode +" position = "+position +" serviceId = "+serviceId);


                Intent onlineAnswerCordovaIntent = getBaseIntent(0, mActivity, NewBookDetailH5Activity.class);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_OBJ, moduleContent);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_MODULE, module);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_DOWNLOAD_INFO, downLoadInfo);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_H5_PAGE_TYPE_SOURCE, from);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_ID, contentId);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_WORK_ID, workId);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_POSITION, position);
                onlineAnswerCordovaIntent.putExtra(IntentFlag.INTENT_FLAG_SERVICE_ID, serviceId);
                onlineAnswerCordovaIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
                mActivity.startActivityForResult(onlineAnswerCordovaIntent, requestCode);

            }

            @Override
            public void failed(int errorCode, Object data) {
                try {
                    EventBus.getDefault().post(new HideDownloadDialogBean(true));

                    if (!NetworkUtils.isOnline()) {
                        ToastUtil.INSTANCE.toastCenterNoNetError();
                    }
                } catch (Exception e) {

                }
            }

            @Override
            public void failed(Object data) {
                try {
                    EventBus.getDefault().post(new HideDownloadDialogBean(true));

                    if (!NetworkUtils.isOnline()) {
                        ToastUtil.INSTANCE.toastCenterNoNetError();
                    }
                } catch (Exception e) {

                }
            }
        });

    }



    /**
     * 跳到兑吧h5页面
     *
     * @param act
     * @param goBackId
     * @param url
     */
    public static void jumpToDuiBaActivity(Activity act, int goBackId, String url) {

        Intent intent = getBaseIntent(goBackId, act, DuiBaActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_URL, url);
        act.startActivity(intent);
    }

    /**
     * 跳转到配音资源页面
     *
     * @param goBackId 启动activity
     * @param context
     */
    public static void jumpToDubVideoListActivity(int goBackId, Activity context) {
        Intent intent = getBaseIntent(goBackId, context,
                DubVideoListActivity.class);
        context.startActivity(intent);
    }


    /**
     * 新 跳转到我的作品
     * @param goBackId
     * @param context
     */
    public static void jumpToDubVideoMineActivity(int goBackId, Activity context) {
        Intent intent = getBaseIntent(goBackId, context,
                DubVideoListActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳转到搜索配音界面
     */
    public static void jumpToSearchDubActivity(int goBackId, Activity activity) {
        Intent baseIntent = getBaseIntent(goBackId, activity, SearchDubActivity.class);
        activity.startActivity(baseIntent);
    }

    /**
     * 跳转到配音记录页面
     *
     * @param goBackId 启动activity
     * @param context
     */
    public static void jumpToDubVideoRecordListActivity(int goBackId, Activity context) {
        Intent intent = getBaseIntent(goBackId, context,
                DubVideoRecordListActivity.class);
        context.startActivity(intent);
    }

    /**
     * @param context
     * @param backId  R.string.go_back
     * @param title   标题
     */
    public static void jumpToDubVideoRecordDetailH5Activity(Activity context,
                                                            int backId, String title, String doWorkId) {
        Intent intent = getBaseIntent(backId, context,
                DubVideoRecordDetailH5Activity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, doWorkId);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, title);
        context.startActivity(intent);
    }

    /**
     * 跳转到视频界面
     *
     * @param goBackId
     * @param context
     * @param
     */
    public static void jumpToDubVideoDetailActivity(int requesttCode, int goBackId, Activity context, String workId, WorkContent workContent, String classId, int contentId, boolean isFromWork) {
        Intent intent = getBaseIntent(goBackId, context,
                DubVideoDetailActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, workContent);
        intent.putExtra(IntentFlag.INTENT_FLAG_WORK_ID, workId);
        intent.putExtra(IntentFlag.INTENT_FLAG_CONTENTID, contentId);
        intent.putExtra(IntentFlag.INTENT_FLAG_CLASS_ID, classId);
        intent.putExtra(IntentFlag.INTENT_FLAG_BOOLEAN, isFromWork);
        context.startActivityForResult(intent, requesttCode);
    }

    /**
     * 跳转到音标视频界面
     *
     * @param goBackId
     * @param context
     * @param
     */
    public static void jumpToSymbolVideoActivity(int requesttCode, int goBackId, Activity context, String workId, WorkContent workContent, String classId, int contentId) {
        Intent intent = getBaseIntent(goBackId, context,
                DubVideoDetailActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, workContent);
        intent.putExtra(IntentFlag.INTENT_FLAG_WORK_ID, workId);
        intent.putExtra(IntentFlag.INTENT_FLAG_CONTENTID, contentId);
        intent.putExtra(IntentFlag.INTENT_FLAG_CLASS_ID, classId);
        context.startActivityForResult(intent, requesttCode);
    }

    /**
     * 跳转到视频配音界面
     *
     * @param goBackId
     * @param context
     * @param
     */
    public static void jumpToDubVideoRecordingActivity(int requesttCode, int goBackId, Activity context, String workId, WorkContent workContent, String classId, int contentId) {
        Intent intent = getBaseIntent(goBackId, context,
                DubVideoRecordingActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, workContent);
        intent.putExtra(IntentFlag.INTENT_FLAG_WORK_ID, workId);
        intent.putExtra(IntentFlag.INTENT_FLAG_CONTENTID, contentId);
        intent.putExtra(IntentFlag.INTENT_FLAG_CLASS_ID, classId);
        context.startActivityForResult(intent, requesttCode);
    }

    /**
     * 跳转到信息保护指引
     *
     * @param goBackId
     * @param context
     * @param url
     * @param title
     */
    public static void jumpFirstAgreementActivity(int goBackId, Activity context, String url, String title, String action) {
        Intent intent = getBaseIntent(goBackId, context, FirstAgreementActivity.class);
        intent.putExtra(BrowserActivity.IntentString.INTENT_STRING_URL, url);
        intent.putExtra(BrowserActivity.IntentString.INTENT_STRING_TITLE, title);
        intent.putExtra(IntentFlag.INTENT_FLAG_ACTION, action);
        context.startActivity(intent);
    }

}
